<script>
	import {
		fontUtil
	} from '@/uni_modules/uview-plus';
	import {
		useBluetoothStore
	} from '@/store';
	export default {
		onLaunch: function() {
			console.log('App Launch');



		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		mounted() {

			const bluetoothStore = useBluetoothStore();
			// 清除 QMS 蓝牙设备连接状态
			let connectedDevices = bluetoothStore.connectedDevices;
			console.log(connectedDevices);
			Object.keys(connectedDevices).forEach(key => {
				connectedDevices[key]['connected'] = false;
			});
			bluetoothStore.connectedDevices = connectedDevices;
			fontUtil.loadFont();
		},
		onUnload() {

			// 清除蓝牙连接监听器
			uni.$off("bluetooth:handleCommand");
			// 清除已连接设备的测量数据监听器
			uni.$off("send:bluetooth-data");
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-plus/index.scss";
	@import '@/static/assets/style/scss/base.scss';

	@font-face {
		font-family: CustomFontPlatform;
		src: url("/static/assets/font/platformfont/iconfont.ttf") format('truetype');

		font-display: auto;
		font-style: normal;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}
</style>